#!perl -T

use strict;
use warnings;
use Test::More;
use Date::Simple qw/date today ymd/;

BEGIN {
	use_ok( 'NaturalDateGuesser' );
}

my $parser = NaturalDateGuesser->new();

my $today = today();
my $day_of_week = $today->day_of_week;


my $list = [
[ "10-05-2006", ymd(2006, 5, 10) ],
[ "01-03-2001", ymd(2001, 3, 1) ],
[ "1-1-2007", ymd(2007,1,1) ],
[ "31-12-2007", ymd(2007,12,31) ],
[ "1-31-2007", ymd(2007,1,31) ],
[ "1-1-07", ymd(2007,1,1) ],
[ "10-1-07", ymd(2007,1,10) ],
[ "1-10-07", ymd(2007,10,1) ],
[ "2001-10-07", ymd(2001,10,7) ],
];

plan tests => scalar @$list;

foreach my $item (@$list)
{
	my ($string, $expected) = @$item;
	is($parser->parseDate($string), $expected, 
		"Parse $string");
}

